{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 起飞前自检报错信息分析\n",
    "\n",
    "## 前言\n",
    "\n",
    "> APM：Copter多旋翼 固件内部有一套非常完善的Pre-Arm安全检查提醒机制，会检查你的飞行器是否有大量问题,包括各种未校准，已经是否传感器已经出现损坏，当然这解锁检查机制也不是百分百可靠的，你可以通过在全部参数列表Arming-check 禁用它\n",
    ">\n",
    "> **注意：因为飞控固件版本的不断更新，有可能一些错误信息会有所改变，可能与本文出现不一致，或者本文没有说明的错误；都是正常情况。可以自行使用搜索引擎搜索一下**\n",
    "\n",
    "使用QCG地面站查看Pre-Arm错误信息\n",
    "\n",
    "\n",
    "在闪烁黄色灯时，使用者会无法解锁，而且解锁时蜂鸣器也会长鸣2下。此时你必须连接上地面站，才能排除究竟是什么问题导致了不能解锁和飞行，一般通常是 传感器未校准 或者出现了失控保护、低压设置不正确等等，下面会详细分析每种报错内容:\n",
    "\n",
    "```\n",
    "阅读下面内容前，请确保你已经使用并连接地面站、做了飞控板校准以及会简单使用遥控器。\n",
    "如果还不会，请查看之前的章节\n",
    "```\n",
    "\n",
    "使用Pre-Arm信息分析不能解锁原因：\n",
    "\n",
    "1. 飞控板已经连接好遥控器接收机，并 **拆除螺旋桨** 和动力电池\n",
    "2. 通过USB或者数传连接上地面站（电脑地面站：Mission Planner或者QGC）\n",
    "3. 打开你的遥控器，并试图解锁[解锁通道是：油门最低 (3通道）、YAW最右（4通道）\n",
    "4. 此时，在地面站窗口应该可以看见 **红色** 的Pre-Arm 错误提示， **如果没有任何提示** ，一般是 **解锁通道不正确** 导致飞控无法感知你的解锁操作；你还可以在地面站 飞行数据 界面-状态栏 点解锁操作\n",
    "\n",
    "------\n",
    "\n",
    "## 解锁失败的提示信息：\n",
    "\n",
    "------\n",
    "\n",
    "### 1. 遥控器常见错误提示：\n",
    "\n",
    "#### NO RC Receiver\n",
    "\n",
    "**（没有遥控器接收机）**\n",
    "\n",
    "请检测接收机的信号输入是否正常，检查一下有没有对码\n",
    "\n",
    "解决方案：\n",
    "\n",
    "1：如果是使用PPM编码器小板，检查一下PPM编码器 蓝色状态灯是否还会闪烁（可以判断PPM编码器是否还在工作）\n",
    "\n",
    "2：如果使用SBUS和PPM接收机，检查接收机设置是否正确\n",
    "\n",
    "3：有可能飞控硬件固件，需要返厂检修，一般可能性比较小\n",
    "\n",
    "#### RC not calibrated \n",
    "\n",
    "**（遥控器未校准）**\n",
    "\n",
    "遥控器还未校准，或者范围不在飞控记录值内，通常都是设置了遥控器或者换了遥控器导致，请重新做校准既可\n",
    "\n",
    "RC3油门通道MIN最小值及MAX最大值理想范围是1100-1900.\n",
    "\n",
    "而其他通道最小值不要大于1300和最大值不要小于1700。理想值也是1100-1900\n",
    "\n",
    "-----\n",
    "\n",
    "### 2. 电子罗盘常见错误提示：\n",
    "\n",
    "#### **Compass not healthy**\n",
    "\n",
    "（**电子罗盘不健康**）\n",
    "\n",
    "电子罗盘不健康的提示，也有可能是没有数值或者硬件损坏\n",
    "\n",
    "也有可能环境温度低于0下，可能会导致罗盘传感器没有数值\n",
    "\n",
    "解决方案：\n",
    "\n",
    "1. 重新上电\n",
    "2. 如果温度过低，请做好保温措施，重新上电\n",
    "3. 在地面站-状态检查罗盘数值是否正确 MX1 MY1 MZ1 \\MX2 MY2 MZ2\n",
    "\n",
    "#### **Compass not calibrated**\n",
    "\n",
    "（**罗盘没有校准**）\n",
    "\n",
    "罗盘没有校准，或者罗盘被移除和新增，都会提示罗盘未校准\n",
    "\n",
    "解决方案：\n",
    "\n",
    "1. 安装好罗盘后，重新做校准\n",
    "\n",
    "#### **Compass offsets too high**\n",
    "\n",
    "**（罗盘偏移值太高）**\n",
    "\n",
    "主罗盘的偏移值 $(i.e. sqrt(x^2+y^2+z^2)) $ 大于500，就会提示这个，一般情况都是飞控或者GPS附近有**磁性物体（马达、螺丝、电池等）**导致，或者环境有比较强的磁场干扰。\n",
    "\n",
    "解决方案：\n",
    "\n",
    "1. 请排除干扰后重新上电\n",
    "2. 重新换一个位置安装飞控或者GPS，重新校准\n",
    "3. 换一个环境试试\n",
    "\n",
    "#### Check mag field\n",
    "\n",
    "**（检查罗盘磁场）**\n",
    "\n",
    "如果在室内、或换了不同环境、或附近有磁干扰可能会提示这个错误\n",
    "\n",
    "解决方案：\n",
    "\n",
    "1. 如果换了环境，重新做校准即可\n",
    "2. 如果在室内或者有干扰源，离开干扰源即可\n",
    "\n",
    "#### **Compasses inconsistent：**\n",
    "\n",
    "**（罗盘不一致）**\n",
    "\n",
    "内部罗盘和外部罗盘指向不一致（>45度）。这通常是外部罗盘方向设置不正确导致（compass_orient）\n",
    "\n",
    "解决方案：\n",
    "\n",
    "1. 重新做校准即可。选择PX4 校准，方向不用选择\n",
    "\n",
    "-------\n",
    "\n",
    "### 3. GPS常见故障：\n",
    "\n",
    "#### **GPS Glitch / Need 3D Fix**\n",
    "\n",
    "**（GPS故障） / (需要3D定位)**\n",
    "\n",
    "如果GPS未定位成功或者没有GPS.而且使用了需要GPS的飞行模式(Loiter Poshold)或者电子围栏被启动，就会提示这2个错误信息\n",
    "\n",
    "解决方案：\n",
    "\n",
    "1. 如果没有安装GPS或者在室内飞行，**请切换到不需要GPS的模式**\n",
    "2. 等待GPS被3D FIX定位\n",
    "3. NO GPS 没有检查到GPS硬件：检查连接线\n",
    "4. NO FIX没有3D锁定，请把飞行器和GPS放在室外无遮挡的地方\n",
    "\n",
    "#### **Bad Velocity**\n",
    "\n",
    "**（坏的速度）**\n",
    "\n",
    "一般是GPS飘逸速度过快，高于50CM/S\n",
    "\n",
    "这个问题可能是移动速度过快，或者加速计没有正确校准，或者GPS刷新率低于5HZ。\n",
    "\n",
    "解决方案：\n",
    "\n",
    "1. 等待GPS卫星锁定更多数量。HDOP小于1.5\n",
    "\n",
    "#### **High GPS HDOP**\n",
    "\n",
    "**（HDOP不达标，不够小；数字越小达标精度越高）**\n",
    "\n",
    "卫星定位精度HDOP过高，一般是卫星数量不够导致\n",
    "\n",
    "解决方案：\n",
    "\n",
    "1. 放在室外无遮挡环境。等待几分钟，卫星锁定更多后\n",
    "\n",
    "HDOP在地面站这个位置可以看见\n",
    "\n",
    "![img](http://doc.cuav.net/tutorial/copter/assets/hdop.png)\n",
    "\n",
    "### 4.加速计和陀螺仪检查\n",
    "\n",
    "#### **INS not calibrated**\n",
    "\n",
    "**（INS加速计没有校准）**\n",
    "\n",
    "加速计没有校准，或者校准不正确\n",
    "\n",
    "解决方案：\n",
    "\n",
    "1. 重新校准加速计。查看校准加速计章节\n",
    "\n",
    "#### **Accels not healthy**\n",
    "\n",
    "**（加速计不健康）**\n",
    "\n",
    "这可能是一个硬件问题，也有可能是刷了固件之后，马上启动飞控，也会提示这个错误\n",
    "\n",
    "解决方案：\n",
    "\n",
    "1. 重新上电飞控板，并重新连接\n",
    "2. 联系CUAV技术支持部门解决\n",
    "\n",
    "#### **Gyros not healthy**\n",
    "\n",
    "**（陀螺仪不健康）**\n",
    "\n",
    "陀螺仪数据跳动比较厉害，数值不在范围、没有数据，这也可能是一个硬件问题，或者上电时没有静止，导致的报错\n",
    "\n",
    "解决方案：\n",
    "\n",
    "1. 放平不动，重新上电\n",
    "2. 如果尝试重新上电几次还是有问题，请联系CUAV技术部门进行排除\n",
    "\n",
    "#### Gyro cal failed\n",
    "\n",
    "**（陀螺仪校准失败）**\n",
    "\n",
    "一般是上电时（在红蓝灯闪烁时，被断了电源。或者数值超过峰值也会导致这个错误信息）\n",
    "\n",
    "解决方案：\n",
    "\n",
    "1. 重新放平上电\n",
    "\n",
    "#### **Gyros inconsistent**\n",
    "\n",
    "**（陀螺仪不一致）**\n",
    "\n",
    "2个陀螺仪的旋转利率相差20度/秒以上，这有可能是一个硬件故障，或者是陀螺仪标定不正确\n",
    "\n",
    "解决方案:\n",
    "\n",
    "1. 重新上电\n",
    "2. 联系CUAV技术部门\n",
    "\n",
    "#### **Check Board Voltage**\n",
    "\n",
    "**（检查主板电压）**\n",
    "\n",
    "当主板电压低于4.3 高于5.8V时，就会出发**Check Board Voltag**\n",
    "\n",
    "使用过低的USB电压供电也会触发。\n",
    "\n",
    "如果这是从一个电源模块供电，都会提示检查**主板电压**，这可能是一个严重的问题\n",
    "\n",
    "解决方案：\n",
    "\n",
    "1. 检查供电电压是否在5V左右\n",
    "2. 使用CUAV IV 模块供电或者标准的5V电压模块\n",
    "\n",
    "#### Check FS_THR_VALUE\n",
    "\n",
    "**（检查失控油门值）**\n",
    "\n",
    "当前油门值过低，已经触发了失控保护\n",
    "\n",
    "解决方案：\n",
    "\n",
    "1. 检查遥控器油门通道设置，正常值不要低于1000，最合适的值在1100左右\n",
    "2. 检查地面站-失控保护设置-油门值是否设置的过高\n",
    "\n",
    "#### bad loging/loging failed\n",
    "\n",
    "**（储存日志失败）**\n",
    "\n",
    "未识别到sd卡，请检查sd卡是否插好或者拔插一下sd卡。\n",
    "\n",
    "插拔sd卡如果还提示，可以将sd卡格式化后插入\n",
    "\n",
    "#### ACRO_BAL_ROLL/PITCH:\n",
    "\n",
    "ACRO_BAL_ROLL参数高于自稳 roll的P值和/或ACRO_BAL_PITCH参数高于稳定pitch的P值。 这可能导致飞行员无法控制ACRO模式的倾斜角度，因为Acro Trainer的稳定将会超过飞行员的输入。\n",
    "\n",
    "## 关闭安全解锁检查：\n",
    "\n",
    "![img](http://doc.cuav.net/tutorial/copter/assets/check.png)\n",
    "\n",
    "如果你觉得报错是无意义的，而且又影响你的解锁飞行，你可以通过地面站关闭。\n",
    "\n",
    "1. 飞控连接到地面站（使用usb或者数传）\n",
    "2. 配置/调试 选项>标准参数\n",
    "3. ARMING_CHECK选择disable > 写入参数\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
